import {defineStore} from 'pinia'
import buyApi,{type buyNavItemData,type TopicsData} from '../api/buy'
interface BuyStoreStateData{
    navList:buyNavItemData[]
}
export const useBuyStore = defineStore('buy',{ 
    state():BuyStoreStateData{
        return {
            navList:[]
        }
    },
    actions:{
        async  getInitData_buy(){
            try {
              const res = await buyApi.getInitBuyData()
              this.navList = res.data.navList
              return 'ok'
            } catch (error) {
                return new Error('获取失败')
            }
          }
    },
    getters:{

    }
    
})